const label = '宫格'
const name = 'DkAppGoldGrid'

export default {
  icon: 'tdesign:work',
  label,
  name,
  rule() {
    return {
      type: name,
      props: {
        imageStyle: {
          width: '40px',
          height: '40px',
          marginBottom: '10px',
          borderRadius: '10px'
        }
      },
      showStyle: true,
      children: [],
      style: {},
      setting: {
        style: {}
      }
    }
  },
  props() {
    return [
      { type: 'number', field: 'columnNum', title: '每行个数', value: 4 },
      {
        type: 'DkGroup',
        field: 'list',
        title: '',
        props: {
          title: '宫格内容',
          defaultValue: {
            title: '这是标题',
            image: import.meta.env.VITE_BASE_URL + '/assets/addons/gs_gold/icon.png'
          },
          rule: [
            { type: 'input', field: 'title', title: '标题' },
            { type: 'DkImageInput', field: 'image', title: '图片' },
            { type: 'input', field: 'path', title: '地址' }
          ]
        }
      },
      {
        type: 'switch',
        field: 'useImageStyle',
        title: '图片样式',
        control: [
          {
            value: true,
            rule: [
              {
                type: 'DkStyleInput',
                field: 'imageStyle',
                // title: '样式配置',
                props: {
                  isDrawer: true,
                  drawerProps: {
                    title: '卡片样式',
                    size: '400px',
                    zIndex: 100
                  },
                  hideComponents: ['DkStyleFontInput', 'DkStyleBackgroundInput']
                }
              }
            ]
          }
        ]
      }
    ]
  }
}
